import unittest

from parameterized import parameterized

from api.py_04_ihrm_login import ihrm_login
from common.py_05_tools import Tools_unitest

# 定义测试类方法
class Testihrmlogin(unittest.TestCase):
    # 参数化将测试方法加入
    @parameterized.expand(Tools_unitest.build_data_tools())
    # 定义方法将数据按顺序传入
    def test01_login(self, case, jsonData, status_code, success, code, message):
        json_data = jsonData
        resp = ihrm_login.hrm_login(json_data)
        print(case, resp.json())
        Tools_unitest.assert_tools(self, resp, status_code, success, code, message)
